<?php
include_once('ClsSebent/config.php');

if($action=="Login")
{
$q="select * from buyers where Bid='$Bid' and Bpass='$Bpass'";
$r=mysql_query($q);
$row=mysql_fetch_array($r);
if($row['Bid']==""){?>
<script type="text/javascript">
alert("Sorry!! No such buyer existing.");
window.location.assign('cart_view.php?site_id=<?php echo $_SESSION['SITE_ID'];?>');
</script>
<?php } else{
//setcookie("buyer",$Bid.'*'.$row['id'],time()+604800);
$_SESSION["BUYER_ID"]=$row["id"];
$_SESSION["BUYER_NAME"]=$row["fname"]." ".$row["lname"];
?>
<script type="text/javascript">
alert('Login Succeed!!');
window.location.assign('cart_view.php?site_id=<?php echo $_SESSION['SITE_ID'];?>');
</script>
<?php }
}
?><style type="text/css">
<!--
body,td,th {
	color: #FFFFFF;
}
body {
	background-color: #000000;
}
-->
</style>
<form name="frm" method="post" action="buyer_login.php?site_id=<?php echo $_SESSION['SITE_ID'];?>">
<table width="277" border="0">
  <tr>
    <td colspan="2"><h2 align="center">Buyer's Login </h2></td>
  </tr>
  <tr>
    <td width="69">Buyer Id </td>
    <td width="198"><input type="text" name="Bid" /></td>
  </tr>
  <tr>
    <td>Password</td>
    <td><input type="password" name="Bpass" /></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input type="submit" name="action" value="Login" /></td>
  </tr>
</table>
</form>